<template>
	<view class="wrap">
		<view class="tab bottom_line">
			<view :class="{tab_item, active: current == index}" v-for="(item,index) in tab" :key="index"
				@click="current = index">{{item}}</view>
		</view>

		<u-read-more :shadow-style="shadowStyle" close-text="展开全部" :show-height="300" toggle="true">
			<rich-text v-show="current == 0">
				<view class="bottom_line swiper_item">
					<text>豌豆凉粉</text>
					<text>500g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>小葱末</text>
					<text>20g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>榨菜末</text>
					<text>50g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>花生碎</text>
					<text>50g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>姜末</text>
					<text>10g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>白术</text>
					<text>10g</text>
				</view>
			</rich-text>
			<rich-text v-show="current == 1">
				<view class="bottom_line swiper_item">
					<text>鸡蛋</text>
					<text>2个</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>糖</text>
					<text>30g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>盐</text>
					<text>1g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>淡奶油</text>
					<text>140g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>低筋面粉</text>
					<text>140g</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>无铝泡打粉</text>
					<text>2g</text>
				</view>
			</rich-text>
			<rich-text v-show="current == 2">
				<view class="bottom_line swiper_item">
					<text>川北凉粉</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>川北凉粉</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>川北凉粉</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>川北凉粉</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>川北凉粉</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>川北凉粉</text>
					<text>暂无数据</text>
				</view>
			</rich-text>
			<rich-text v-show="current == 3">
				<view class="bottom_line swiper_item">
					<text>牛肉披萨</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>牛肉披萨</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>牛肉披萨</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>牛肉披萨</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>牛肉披萨</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>牛肉披萨</text>
					<text>暂无数据</text>
				</view>
			</rich-text>
			<rich-text v-show="current == 4">
				<view class="bottom_line swiper_item">
					<text>奶油泡芙</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>奶油泡芙</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>奶油泡芙</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>奶油泡芙</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>奶油泡芙</text>
					<text>暂无数据</text>
				</view>
				<view class="bottom_line swiper_item">
					<text>奶油泡芙</text>
					<text>暂无数据</text>
				</view>
			</rich-text>
		</u-read-more>
	</view>
</template>

<script>
	export default {
		name: "mytabs",
		data() {
			return {
				tab: ["所有食材", "蜜豆鲷鱼烧", "川北凉粉", "牛肉披萨", "奶油泡芙"],
				current: 0,
				shadowStyle: {
					backgroundImage: "none",
					paddingTop: "0",
					marginTop: "20rpx"
				},
			};
		},
		methods: {
		}
	}
</script>

<style scoped lang="scss">
	.wrap {
		width: 100%;
		background: #fff;

		.bottom_line {
			padding: 6rpx 0;
			border-bottom: 2rpx solid #ccc;
		}

		.tab {
			display: flex;
			justify-content: space-evenly;

			.tab_item {
				flex-grow: 1;
				text-align: center;
				padding: 20rpx 0;
				border-bottom: 10rpx solid transparent;
			}

			.active {
				color: #FAB10A;
			}
		}


		.swiper_item {
			display: flex;
			text-indent: 0;
			margin: 0 30rpx;

			text {
				font-size: 24rpx;
				width: 300rpx;
			}
		}

	}
</style>
